package model

import "time"

type MoonState int

const (
	MoonCreated MoonState = iota
	MoonInit
	MoonConnected
	MoonDisconnected

	MoonAllState = 255
)

type Moon struct {
	ID        string    `gorm:"size:40;primary_key:true"` // MoonID
	Name      string    `gorm:"size:40"`                  // 节点名称
	State     MoonState `gorm:"NOT NULL"`                 // 节点状态
	Signature string    `gorm:"size:64"`                  // 节点证书签名
	CreatedAt time.Time
}

type MoonInfo struct {
	// MoonID
	ID string `gorm:"size:40;primary_key:true"`
	// 节点指令集架构
	Arch string `gorm:"size:10"`
	// 核心数
	Cores int `gorm:"default:0;not null"`
	// 系统内核版本
	Kernel string `gorm:"size:24"`
	// CPU型号
	CPU string `gorm:"size:64"`
	// 宿主机操作系统
	OS string `gorm:"size:64"`
}
